Declare Function FindWindow Lib "User"(lpClassName As Long, lpWindowName \ As String) As Integer Sub MAIN On Error Goto TrashError Dim x, y, FileLen, ChanNum NULL = 0 WinName$ = String$(65, 0) WinName$ = "Steve's McTrash Dumpster" x = FindWindow(NULL, WinName$) If x = 0 Then MsgBox "Steve's McTrash Dumpster is not running; please start it up before using this macro!", \ "Steve's Mctrash Dumpster Macro", 48 Goto Done End If DocName$ = String$(255, 0) Execute$ = String$(128, 0) DocName$ = FileName$() FileLen = Len(FileName$()) DocName$ = Left$(DocName$, FileLen) FileClose 2 ChanNum = DDEInitiate("McTrash", "Form1") Execute$ = "ZAP=" + DocName$ DDEExecute ChanNum, Execute$ DDETerminate ChanNum Goto Done TrashError: If Err = 503 Then Goto Done Else MsgBox "An unknown error has occurred, terminating macro execution", \ "Steve's McTrash Dumpster Macro", 64 End If Done: End Sub